<?php
$portfolioData = $this->PortfolioData;
//Zend_Debug::dump($this->get_id);exit();
if ($this->get_id == 0) {
?>
    <div class="contentcontainer">
        <div class="headings altheading">
            <h2>Contact editing</h2>
        </div>

        <div class="contentbox">
            <div align="left"><H1><a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/'.$this->controller.'/add/'; ?>">+</a></H1></div>
            <table width="100%">
                <thead>
                    <tr>
                        <th>Project name</th>
                        <th>Case study</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                <?php foreach ($portfolioData as $row) {
 ?>
                    <tr class="alt">
                        <td><?php echo $row['type']; ?></td>
                        <td><?php echo substr($row['title'], 0, 70); ?></td>
                        <td>
                            <a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/contact/edit/id/' . $row['id']; ?>" title=""><img SRC="/img/icons/icon_edit.png" alt="Edit" /></a>&nbsp;&nbsp;&nbsp;
                            <a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/contact/edit/id/' . $row['id'] . '/del/1/'; ?>" title=""><img SRC="/img/icons/icon_delete.png" alt="Delete" /></a>
                        </td>
                    </tr>
<?php } ?>
            </tbody>
        </table>
            <div align="left"><H1><a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/'.$this->controller.'/add/'; ?>">+</a></H1></div>
        <div style="clear: both;"></div>
    </div>

</div>

<div class="contentcontainer">
    <div class="headings alt">
        <h2>Google Location link</h2>
    </div>
    <div class="contentbox">

<?php echo $this->formGoogle; ?>
            </div>

        </div>

<?php } elseif ($this->get_id > 0 && $this->get_del == 0) { ?>
                <div class="contentcontainer">
                    <div class="headings alt">
                        <h2>Editing contact...</h2>
                    </div>
                    <div class="contentbox">
<?php echo $this->form; ?>
            </div>
        </div>
<?php } elseif ($this->get_id > 0 && $this->get_del == 1) { ?>
                <div class="contentcontainer">
                    <div class="headings alt">
                        <h2>Deleting...</h2>
                    </div>
                    <div class="contentbox" align="center">
                        Are you sure want to delete:
                        <H1><?php echo $this->NameToDelete['title']; ?> ?</H1><br>
                        <form action="<?php echo $this->url(array('module' => 'control', 'controller' => 'contact', 'action' => 'edit')); ?>" method="post">
                            <input type="hidden" name="id" value="<?php echo $this->NameToDelete['id']; ?>" />
                            <input type="submit" name="del" value="<?php echo $this->yesButton; ?>" class="btn" />
                            <input type="submit" name="del" value="<?php echo $this->noButton; ?>" class="btn" />
                        </form>
                    </div>
                </div>
<?php } else {

            } ?>